import request from '@/utils/request'

export function getDepartmentInfoReqest() {
  return request({
    url: '/company/department',
    method: 'GET'
  })
}

// 新增部门接口
export function addDepartmentRequest(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

export function getDeparmentByIdRequest(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'GET'
  })
}

// 根据ID修改部门详情 /company/department/{id}
export function updateDepartmentByIdRequest(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}

// 根据ID删除部门  /company/department/{id}
export function deleteDeparmentByIdRequest(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}
